package com.heima.common;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author brianxia
 * @version 1.0
 * @date 2022-11-11 10:40
 */
//@Configuration //把这个类变成配置类
@EnableConfigurationProperties(TestProperty.class)
public class TestConfig {

    @Bean //将方法返回对象初始化的时候放到spring容器中
    public Test2 test(TestProperty testProperty){
        String a = testProperty.getA();
        return new Test2();
    }
}
